package nettyTcp

import "net"

type Handler interface {
	Handle(ctx *HandlerContext, data interface{}) error
}

type HandlerContext struct {
	conn net.Conn
	next Handler
}

type Pipeline struct {
	handlers []Handler
}

func NewPipeline() *Pipeline {
	return &Pipeline{}
}

func (p *Pipeline) AddHandler(handler Handler) {
	p.handlers = append(p.handlers, handler)
}

func (p *Pipeline) Process(conn net.Conn) {
	// 实现数据在处理器链中的传递
}
